import { RouteRecordRaw, RouterView } from 'vue-router'

import { redirectPath } from '../help'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/user-manage',
    component: RouterView,
    meta: { title: '账号管理', auth: ['admin-user-manage-student-list', 'admin-user-manage-admin-list'] },
    redirect: redirectPath,
    children: [
      {
        path: '/user-manage/student-list',
        name: 'student-list',
        component: () => import('@/views/admin/user-manage/list/index.vue'),
        meta: { title: '学生列表', auth: ['admin-user-manage-student-list'] }
      },
      {
        path: '/user-manage/admin-list',
        name: 'admin-list',
        component: () => import('@/views/admin/user-manage/list/index.vue'),
        meta: { title: '用户列表', auth: ['admin-user-manage-admin-list'] }
      },
      {
        path: '/user-manage/detail/:id',
        name: 'admin-detail',
        component: () => import('@/views/admin/user-manage/detail/index.vue'),
        meta: { title: '用户详情', auth: ['admin-user-manage-admin-list', 'admin-user-manage-student-list'] }
      },
      {
        path: '/user-manage/life',
        name: 'user-manage-life',
        component: RouterView,
        children: [
          {
            path: '/user-manage/life/app-check-app-detail/:id',
            component: () => import('@/views/admin/user-manage/life/app-check-app-detail/index.vue'),
            meta: { title: '应用审核详情--生命周期特供版', auth: ['admin-user-manage-admin-list', 'admin-user-manage-student-list'] }
          },
          {
            path: '/user-manage/life/app-check-detail/:id',
            component: () => import('@/views/admin/user-manage/life/app-check-detail/index.vue'),
            meta: { title: '应用详情--生命周期特供版', auth: ['admin-user-manage-admin-list', 'admin-user-manage-student-list'] }
          },
          {
            path: '/user-manage/life/app-detail/:id',
            component: () => import('@/views/admin/user-manage/life/app-detail/index.vue'),
            meta: { title: '应用详情--生命周期特供版', auth: ['admin-user-manage-admin-list', 'admin-user-manage-student-list'] }
          }
        ]
      }
    ]
  }
]

export default routes
